package com.ouman.luoliluoli;

import android.os.Bundle;
import android.support.design.widget.FloatingActionButton;
import android.support.design.widget.Snackbar;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.View;
import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.ouman.luoliluoli.utils.ThemeChanger;

public class MeiziDetailActivity extends AppCompatActivity {

    private ImageView imageViewDetail;
    private String imageUrl;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        ThemeChanger.applyTheme(this, null);
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_meizi_detail);
        Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
        toolbar.setTitle("");
        setSupportActionBar(toolbar);
        getSupportActionBar().setDisplayHomeAsUpEnabled(true);


        imageViewDetail = (ImageView) findViewById(R.id.imageViewMeiziDetail);
        FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);

        Bundle bundle = this.getIntent().getExtras();
        imageUrl = bundle.getString("imageUrl");

        Glide.clear(imageViewDetail);
        Glide.with(MeiziDetailActivity.this)
                .load(imageUrl)
                .asBitmap()
                .error(R.drawable.bk_beauty)
                .into(imageViewDetail);
        fab.show();



        fab.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Snackbar.make(view, "妹子图片已经保存到了本地", Snackbar.LENGTH_LONG)
                        .setAction("撤销", new View.OnClickListener() {
                            @Override
                            public void onClick(View view) {

                            }
                        }).show();
            }
        });
    }

}
